package mop.model.task;

import java.sql.Timestamp;

/**
 * Memento class for Schedule
 */
public class ScheduleMemento {
	
	/**
	 * Constructor with current attributes of a schedule
	 * @param start		Start date
	 * @param duration	Duration
	 * @param deadline	Deadline
	 * @post start is set to given start
	 * 	|this.start == start
	 * @post duration is set to given duration
	 * 	|this.duration == duration
	 * @post deadline is set to given deadline
	 * 	|this.deadline == deadline
	 */
	public ScheduleMemento(Timestamp start,Timestamp duration,Timestamp deadline)
	{
		this.start = start == null ? null : new Timestamp(start.getTime());
		this.duration = duration == null ? null : new Timestamp(duration.getTime());
		this.deadline = deadline == null ? null : new Timestamp(deadline.getTime());
	}
	
	/**
	 * Start inspector
	 * @return start
	 */
	public Timestamp getStart() {
		return start;
	}
	
	/**
	 * Duration inspector
	 * @return duration
	 */
	public Timestamp getDuration() {
		return duration;
	}
	
	/**
	 * Deadline inspector
	 * @return deadline
	 */
	public Timestamp getDeadline() {
		return deadline;
	}
	
	/**
	 * Attributes of a schedule
	 */
	private Timestamp start;
	private Timestamp duration;
	private Timestamp deadline;
	
}
